package com.lib.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by duqingxiang on 17/5/24.
 */
@Data
@Builder
@Table(name = "agent_qrcode")
@AllArgsConstructor
@NoArgsConstructor
@Entity
public class RentalAgentQRCode {

    //最大超时时间 30天
//    public final static int MAX_TMP_EXPIRE_SECONDS = 2592000;
    public final static int MAX_TMP_EXPIRE_SECONDS = 300;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @Column(unique = true, nullable = false)
    private String openId;

    @Column(unique = true, nullable = false)
    private long agentId;

    private String ticket;
    private String url;
    private long expireSeconds;
    private Date modifyDate;
    private Date createdDate;

}
